#include "tool.h"

uint32_t ticks_to_ms(TickType_t ticks)
{
    uint32_t time_ms = ticks * portTICK_RATE_MS;
    return time_ms;
}

TickType_t ms_to_ticks(uint32_t time_ms)
{
    TickType_t ticks = pdMS_TO_TICKS(time_ms);
    return ticks;
}

uint32_t get_system_time(void)
{
    TickType_t ticks = xTaskGetTickCount();
    uint32_t time_ms = ticks_to_ms(ticks);
    return ticks;
}
